﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using WpfApp4.Models;

namespace WpfApp4.Library
{
    public interface IWait
    {
        bool Tick();
    }

    public class WaitForSeconds : IWait
    {
        public double waitTime = 0;

        public WaitForSeconds(float time)
        {
            waitTime = time;
        }

        public bool Tick()
        {
            waitTime -= Time.deltaTime;
            //Console.WriteLine("[WaitForSeconds] now left:" + waitTime);
            return waitTime <= 0;
        }
    }

    public class WaitForFrame : IWait
    {
        public float waitTime = 0;

        public WaitForFrame(float time)
        {
            waitTime = time;
        }

        public bool Tick()
        {
            waitTime--;
            //Console.WriteLine("[WaitForFrame] now left:" + waitTime);
            return waitTime <= 0;
        }
    }
}
